﻿namespace Genesis.Infrastructure.Application.Specifications
{

    public abstract class Specification<T> : ISpecification<T>
    {

        public abstract bool IsSatisfiedBy(T candidate);

        public ISpecification<T> And(ISpecification<T> and)
        {

            return new AndSpecification<T>(this, and);

        }

        public ISpecification<T> Or(ISpecification<T> or)
        {

            return new OrSpecification<T>(this, or);

        }

        public ISpecification<T> Not()
        {

            return new NotSpecification<T>(this);

        }

    }

}